from django.shortcuts import render,HttpResponse

# Create your views here.


def upload(request):
    if request.method=='GET':
        return render(request,'shangchuan.html')
    else:
        print('request.POST',request.POST)
        print('request.FILES',request.FILES)
        img=request.FILES.get('img')
        print('name',img.name)
        print('size',img.size)
        f =open(img.name,'wb')
        for i in img.chunks():
            f.write(i)
        return HttpResponse('OK..........')